package me.ymfs.springboot.guice.service.order;

import com.google.inject.AbstractModule;
import com.google.inject.Provides;
import com.google.inject.Scopes;
import me.ymfs.springboot.guice.mapper.OrderMapper;
import me.ymfs.springboot.guice.service.order.impl.OrderServiceImpl;
import org.springframework.context.ApplicationContext;

public class OrderModule extends AbstractModule {
    @Override
    protected void configure() {
        bind(OrderService.class).to(OrderServiceImpl.class).in(Scopes.SINGLETON);
    }

    @Provides
    public OrderMapper orderMapper(ApplicationContext context) {
        return context.getBean(OrderMapper.class);
    }
}
